SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for erp_finance_payment
-- ----------------------------
DROP TABLE IF EXISTS `erp_finance_payment`;
CREATE TABLE `erp_finance_payment`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '付款单号',
  `status` int NULL DEFAULT NULL COMMENT '付款状态 枚举 {cn.iocoder.yudao.module.erp.enums.ErpAuditStatus}',
  `payment_time` datetime NULL DEFAULT NULL COMMENT '付款时间',
  `finance_user_id` bigint NULL DEFAULT NULL COMMENT '财务人员编号 关联 AdminUserDO 的 id 字段',
  `supplier_id` bigint NULL DEFAULT NULL COMMENT '供应商编号 关联 {ErpSupplierDO#getId()}',
  `account_id` bigint NULL DEFAULT NULL COMMENT '付款账户编号 关联 {ErpAccountDO#getId()}',
  `total_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '合计价格，单位：元',
  `discount_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '优惠金额，单位：元',
  `payment_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '实付金额，单位：分 paymentPrice = totalPrice - discountPrice',
  `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '备注',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 付款单';

-- ----------------------------
-- Records of erp_finance_payment
-- ----------------------------
BEGIN;
COMMIT;